Ext.define('School.controller.Splash', {
    extend: 'Ext.app.Controller',
	
    
    config: {
    
        control: {
            '#selectArea': {
                change: 'onAreaChange'
            },
            '#lookupBtn': {
                tap: 'onLookupTap'
            },
            '#settingsBtn': {
                tap: 'onSettingsTap'
            }
        }
    },
    
    //初始化方法
    init: function(){
        Ext.create("School.view.Main");
      
    },
    
    onSettingsTap: function(){
        alert("设置图标点击");
    },
    
    
    onAreaChange: function(field, record){
        if (record) {
            this.currentArea = record;
        }
    },
    
    onLookupTap: function(){
        var splashScreen = Ext.getCmp('splashScreen');
        if (splashScreen.getActiveItem() == Ext.getCmp('settingsForm')) {
            splashScreen.setActiveItem(Ext.getCmp('schoolList'));
        }
        else {
            splashScreen.setActiveItem(Ext.getCmp('settingsForm'));
        }
    }
    
});
